import { defineStore } from "pinia";
import { ref, reactive, computed } from "vue";

export const useTypeStore = defineStore("type", () => {
  const activeIndex = ref(0)
  const menu = reactive(['Ikun','model','knowledge','function', 'frame', 'performance', 'expand','me'])

  const activeName = computed(() => {
    return menu[activeIndex.value]
  })

  const setActiveIndex = (index: number) => {
    activeIndex.value = index
  }

  return { 
    activeIndex,
    activeName,
    setActiveIndex
  };
},{
  persist: true
})